
def collatz(number):
    if number % 2 == 0:
        print(number // 2)
        return number // 2
    else:
        print(3 * number + 1)
        return 3 * number + 1

try:
    num = int(input('请输入一个整数>>>'))
except ValueError:
    print('必须输入整数！')
while True:
    emp = collatz(num)
    if emp == 1:
        break
    num = emp
